package com.hzmw.beetldemo.controller;

import com.hzmw.beetldemo.dto.ParameterDto;
import com.hzmw.beetldemo.server.CodeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author Hzmw
 * @create 2019-01-18 14:45
 * @email mengwei.zhao@nvrchina.com.cn
 * @description
 */
@RestController
@RequestMapping("/code")
public class CodeController {

    @Autowired(required = false)
    private CodeService codeService;

    @PostMapping(value = "/generate")
    @ResponseBody
    public void generate(@RequestBody ParameterDto dto) throws IOException {
        codeService.generate(dto);
    }

}
